<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body bgcolor="#d2691e">
<form action="" method="get">
    <select name="status" id="status">
        {% if status == '-1' %}
            <option value="-1" selected>选择类型</option>
            {% else %}
            <option value="-1">选择类型</option>
        {% endif %}

        {% for i in leave_type %}
            {% if i.id == status %}
                <option selected
                        value="{{ i.id }}">{{ i.tname }}--({{ i.leavemod_set.all.count }})
                </option>
                {% else %}
                <option
                        value="{{ i.id }}">{{ i.tname }}--({{ i.leavemod_set.all.count }})
                </option>
            {% endif %}
        {% endfor %}
    </select>
    <input type="submit" value="过滤">
</form>

{% for leaf in leaves %}
    {{ leaf.stuname }}&nbsp;&nbsp;
    {{ leaf.context }}&nbsp;&nbsp;
    {{ leaf.status }}{{ leaf.get_status_display }}&nbsp;&nbsp;
    {{ leaf.tid.tname }}&nbsp;&nbsp;
    <a href="{% url 'leave:update_leaver' %}?id={{ leaf.id }}&status=1">通过</a>&nbsp;&nbsp;
    <a href="{% url 'leave:update_leaver' %}?id={{ leaf.id }}&status=2">不通过</a>
    <br>
{% endfor %}
<a href="{% url 'leave:show_leaver' %}?page={{ page|add:-1 }}&status={{ status }}">上一页</a>
<a href="#">当前页{{ page }}</a>
<a href="{% url 'leave:show_leaver' %}?page={{ page|add:1 }}&status={{ status }}">下一页</a>

</body>
</html>


